AC_INIT([dvbsnoop],[1.4.56],[info@openvision.tech])
AM_INIT_AUTOMAKE([dist-bzip2 no-define])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])

AC_PROG_CC
AC_PROG_RANLIB

AC_ARG_WITH(dvbincludes,
	[  --with-dvbincludes=PATH  path for dvb includes [[NONE]]],
	[DVBINCLUDES="$withval"],[DVBINCLUDES=""])

if test "$DVBINCLUDES"; then
	CPPFLAGS="$CPPFLAGS -I$DVBINCLUDES"
fi

AC_CHECK_HEADER([linux/dvb/dmx.h])
AC_CHECK_HEADER([ost/dmx.h])

if test "$ac_cv_header_ost_dmx_h" = yes; then
	AC_DEFINE([HAVE_OST_DMX_H])
elif test "$ac_cv_header_linux_dvb_dmx_h" = yes; then
	AC_DEFINE([HAVE_LINUX_DVB_DMX_H])
else
	AC_MSG_ERROR([linux dvb api headers are required to build dvbsnoop])
fi

AC_OUTPUT([
Makefile
src/Makefile
src/bitdata/Makefile
src/datacarousel/Makefile
src/descriptors/Makefile
src/dvb_api/Makefile
src/ebu/Makefile
src/misc/Makefile
src/pes/Makefile
src/sections/Makefile
src/strings/Makefile
src/strings/identifiers/Makefile
src/testdata/Makefile
src/ts/Makefile
src/tvanytime/Makefile
src/private/Makefile
src/private/default/Makefile
src/private/bskyb.uk/Makefile
src/private/eicta.org/Makefile
src/private/nordig.org/Makefile
src/private/premiere.de/Makefile
src/net_ip/Makefile
])

